import ThemeContext from "../context/theme_context";

function withTheme(OriginComponent) {
  // 函数组件的简写
  return props => {
    return (
      <ThemeContext.Consumer>
        {
          value => {
            return <OriginComponent {...value} {...props}></OriginComponent>
          }
        }
      </ThemeContext.Consumer>
    )
  }
}

export default withTheme